# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-clearbit
pkgname=('python2-clearbit' 'python-clearbit')
_pkgname=clearbit
pkgver=0.1.7
pkgrel=11
pkgdesc='Clearbit python bindings.'
arch=('any')
url='https://pypi.python.org/pypi/clearbit/'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://pypi.python.org/packages/50/e7/bbd7c4525cb4ecb74fbe7f4dff6f4112342d9050d64b3be8d56b8c0a028b/$_pkgname-$pkgver.tar.gz")
sha512sums=('15f0a81997bdaa5afb2e3574730f65d3111fc4d779f0d5c7af139353767bb4b22cd4a9c58b6dc86a4b375401abcb2e2608930eab1891eede4a1d7ac6e1eb22c4')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}

  sed -i 's|use_2to3=True|use_2to3=False|g' "$srcdir/$_pkgname-$pkgver/setup.py"
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-clearbit() {
  depends=('python2' 'python2-requests')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-clearbit() {
  depends=('python' 'python-requests')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

